package com.chinairi.mall.controller;


import com.chinairi.common.utils.ResponseUtil;
import com.chinairi.mall.controller.viewobject.HomeAllClassVO;
import com.chinairi.mall.service.IHomeAllClassService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;
import com.chinairi.common.controller.BaseController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Webgasd
 * @since 2020-10-14
 */
@RestController
@RequestMapping("/home-all-class")
public class HomeAllClassController extends BaseController {


    @Autowired
    private IHomeAllClassService iHomeAllClassService;
    /**
     * 获取所有商品分类，树形结构（新方法）
     * @throws Exception
     */
    @GetMapping("/getHomeAllClass")
    public void getHomeAllClass()throws Exception {
        List<HomeAllClassVO> homeAllClassVOList = iHomeAllClassService.getHomeAllClass();
        ResponseUtil.showMessage("success", "获取商品大类", homeAllClassVOList);
    }

}
